package com.javasm.dict.service.impl;

import com.javasm.dict.entity.SysDicType;
import com.javasm.dict.service.TypeService;
import com.javasm.dict.dao.TypeDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class TypeServiceImpl implements TypeService {
    @Resource
    private TypeDao td;
    @Override
    public List<SysDicType> getAll() {
        List<SysDicType> allType = td.getAllType();
        return allType;
    }

    @Override
    public List<SysDicType> getAllByCondition(SysDicType sdt) {
        List<SysDicType> allByCondition = td.getAllByCondition(sdt);
        return allByCondition;
    }

    @Override
    public Boolean insetType(SysDicType dt) {
        int i = td.insetType(dt);
        return i==1;
    }

    @Override
    public Boolean updateType(SysDicType dt) {
        int i = td.updateType(dt);
        return i==1;
    }

    @Override
    public Boolean delByIds(String[] ids) {
        int i = td.delByIds(ids);
        return i>=1;
    }
}
